import request from '@/utils/request'

// 查询设备计划列表
export function listPlan(query) {
  return request({
    url: '/iot/plan/list',
    method: 'get',
    params: query
  })
}
export function alllList(query) {
  return request({
    url: '/iot/plan/alllList',
    method: 'get',
    params: query
  })
}

// 查询设备计划详细
export function getPlan(inspectionPlanId) {
  return request({
    url: '/iot/plan/' + inspectionPlanId,
    method: 'get'
  })
}

// 新增设备计划
export function addPlan(data) {
  return request({
    url: '/iot/plan',
    method: 'post',
    data: data
  })
}

// 修改设备计划
export function updatePlan(data) {
  return request({
    url: '/iot/plan',
    method: 'put',
    data: data
  })
}

// 删除设备计划
export function delPlan(inspectionPlanId) {
  return request({
    url: '/iot/plan/' + inspectionPlanId,
    method: 'delete'
  })
}
// 新增关联
export function addIotPlan(data) {
    return request({
      url: '/iot/plan/addDevice',
      method: 'post',
      data: data
    })
  }


  // 新增关联
export function getDevice(query) {
  return request({
    url: '/iot/plan/getDevice',
    method: 'get',
    params: query
  })
}